<?php

require('../configs/include.php');

class c_constructor extends super_controller {

    public function display() {
        
        
        settype($data,'object');
        $data->id = "1001";
        $data->name = "Pepito";
        $data->salary = 60000;
        $persona1 = new clerk($data);
        $data->id = "1002";
        $data->name = "Pedrito";
        $data->salary = 40000;
        $persona2 = new clerk($data);
        $data->id = "1003";
        $data->name = "Sultano";
        $data->salary = 30000;
        $persona3 = new clerk($data);
        $data->id = "1004";
        $data->name = "Perano";
        $data->salary = 20000;
        $persona4 = new clerk($data);
        $data->id = "1005";
        $data->name = "Carlitos";
        $data->salary = 100000;
        $persona5 = new clerk($data);
        $pers=array($persona1,$persona2,$persona3,$persona4,$persona5);
        
       // echo 'Resultado Menor salario:'.clerk::menorSalario($pers);
        //echo 'Resultado promedio salario:'.clerk::promedioSalario($pers);
                
         
        $this->engine->assign('title', 'Class Constructor');
        $this->engine->assign('personas', $pers);
        $this->engine->assign('menorSalario', clerk::menorSalario($pers));
        $this->engine->assign('promedio', clerk::promedioSalario($pers));
        $this->engine->display('header.tpl');
        $this->engine->display('constructor1.tpl');
        $this->engine->display('footer.tpl');
    }

    public function run() {
        $this->display();
    }

}

$call = new c_constructor();
$call->run();
?>
